package thinkingJava.chapter11;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class Statistics {
	public static void main(String[] args) {
		Random random = new Random(47);
		Map<Integer,Integer> map = new HashMap<Integer,Integer>();
		for (int i = 0 ; i < 10000; i ++) {
			int rand = random.nextInt(20);
			int freq = map.get(rand) == null ? 1 : map.get(rand) + 1;
			map.put(rand, freq);
		}
		System.out.println(map);
	}
}
